using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public enum GUIComponentNames
{
	COMP_NONE = -1

,	COMP_SCREENCENTER
	
,	COMP_MAINMENU_PLAYERAREA
,	COMP_MAINMENU_PLAYBTN	
,	COMP_MAINMENU_STATSBTN
,	COMP_MAINMENU_AUDIOBTN
,	COMP_MAINMENU_FACEBOOK
,	COMP_MAINMENU_CREDITSBTN
,	COMP_MAINMENU_BACKBTN
,	COMP_MAINMENU_FWDBTN
,	COMP_MAINMENU_HINT1
,	COMP_MAINMENU_HINT2
,	COMP_MAINMENU_HELP_PANEL
,	COMP_MAINMENU_HELP_BTN
,	COMP_MAINMENU_EXIT_OK_BTN
,	COMP_MAINMENU_EXIT_CANCEL_BTN
	
,	COMP_UI_BAR
	
,	COMP_CUSTOMIZE_HEAD_LEFTBTN	
,	COMP_CUSTOMIZE_HEAD_RIGHTBTN		
,	COMP_CUSTOMIZE_DRESS_LEFTBTN	
,	COMP_CUSTOMIZE_DRESS_RIGHTBTN	
,	COMP_CUSTOMIZE_PRIMARYCOAT_UPBTN
,	COMP_CUSTOMIZE_PRIMARYCOAT_UPBTN_SEC
,	COMP_CUSTOMIZE_PRIMARYCOAT_DOWNBTN
,	COMP_CUSTOMIZE_PRIMARYCOAT_DOWNBTN_SEC
,	COMP_CUSTOMIZE_SECONDARYCOAT_UPBTN
,	COMP_CUSTOMIZE_SECONDARYCOAT_UPBTN_SEC
,	COMP_CUSTOMIZE_SECONDARYCOAT_DOWNBTN
,	COMP_CUSTOMIZE_SECONDARYCOAT_DOWNBTN_SEC
,	COMP_CUSTOMIZE_EDIT_BTN
,	COMP_CUSTOMIZE_EDIT_BTN_SEC
,	COMP_CUSTOMIZE_HINT3

,	COMP_NETWORK_UPBTN
,	COMP_NETWORK_DOWNBTN	
	
,	COMP_PAUSE_PAUSE
,	COMP_PAUSE_RESUME_BUTT
,	COMP_PAUSE_PAUSE_BUTT
,	COMP_PAUSE_CONFIRM_BUTT
,	COMP_PAUSE_CANCEL_BUTT
,	COMP_PAUSE_QUIT_BUTT
,	COMP_PAUSE_CLOSEMATCH
	

,	COMP_HUD_PAUSEBTN		
,	COMP_HUD_PLAYER1SCOREBG // BG sta per "Background"
,	COMP_HUD_PLAYER2SCOREBG
,	COMP_HUD_PLAYER3SCOREBG
,	COMP_HUD_PLAYER4SCOREBG
,	COMP_HUD_PLAYER1MEDAL
,	COMP_HUD_PLAYER2MEDAL
,	COMP_HUD_PLAYER3MEDAL
,	COMP_HUD_PLAYER4MEDAL	
,	COMP_HUD_PLAYER1HEADICON		
,	COMP_HUD_PLAYER2HEADICON
,	COMP_HUD_PLAYER3HEADICON
,	COMP_HUD_PLAYER4HEADICON
	
,	COMP_GAME_LEFTFOOT
,	COMP_GAME_RIGHTFOOT
,	COMP_GAME_PLUS
,	COMP_GAME_MINUS
,	COMP_GAME_COUNTDOWN
,	COMP_GAME_SWIPEFEEDBACK
,	COMP_GAME_INSHAPE_ACTION
,	COMP_GAME_FEETCHACHA_ACTION
,	COMP_GAME_ROLLING_ACTION
,	COMP_GAME_SPITFIRE_ACTION
,	COMP_GAME_HOM_COUNTER
,	COMP_GAME_HOM_TOTAL
,	COMP_GAME_HOM_POINTS
,	COMP_GAME_HOM_COIN
,	COMP_GAME_HOM_CHARACTER
	
,	COMP_PAUSE_COUNTDOWN


,	COMP_LOADING_BACKGROUND
,	COMP_LOADING_PROGRESS_BACKGROUND
,	COMP_LOADING_PROGRESS_FOREGROUND
	
,	COMP_COUNT
}

public enum GUI3DComponentNames
{
	COMP_NONE = -1

,	COMP_SCREENCENTER
,	COMP_BEYONDLEFTSCREEN
,	COMP_BEYONDRIGHTSCREEN
,	COMP_HEADSELECTORCENTER
,	COMP_DRESSSELECTORCENTER	
,	COMP_PRIMARYCOATSELECTORCENTER	
	
,	COMP_MAINMENU_PLAYER
	
,	COMP_COUNT
}

public enum GUITriggerNames
{
	TRIGGER_NONE = -1

,	TRIGGER_DUMMY
	
,	TRIGGER_MAINMENU_CUSTOMIZE
,	TRIGGER_MAINMENU_PLAY
,	TRIGGER_MAINMENU_CREDITS
,	TRIGGER_MAINMENU_AUDIO
,	TRIGGER_MAINMENU_BACK
,	TRIGGER_MAINMENU_FWD
,	TRIGGER_MAINMENU_EXIT_OK
,	TRIGGER_MAINMENU_EXIT_CANCEL
,	TRIGGER_CUSTOMIZATION_UP		
,	TRIGGER_HELP_BTN
	
,	TRIGGER_HUD_PAUSE
,	TRIGGER_PAUSE_TEXTBUTTON
,	TRIGGER_PAUSE_PAUSEBUTTON
	
,	TRIGGER_GAME_FOOT
,	TRIGGER_GAME_PLUSMINUS
	
,	TRIGGER_COUNT
}
	
public enum GUILabelNames
{
	LABEL_NONE = -1

,	LABEL_DUMMY
,	LABEL_PLAYER1SCORE
,	LABEL_PLAYER2SCORE
,	LABEL_PLAYER3SCORE
,	LABEL_PLAYER4SCORE
	
,	LABEL_GAME_COUNTER
,	LABEL_GAME_REALCOUNTER
,	LABEL_GAME_POINTS
	
,	LABEL_TITLEBAR
,	LABEL_PAUSE_TITLEBAR
,	LABEL_RESUME_BUTTON
,	LABEL_QUIT_BUTTON
,	LABEL_CONFIRM_BUTTON
,	LABEL_CANCEL_BUTTON
,	LABEL_WAIT_CONFIRM
,	LABEL_CONFIRM_QUIT
,	LABEL_CLOSEMATCH_BUTTON
,	LABEL_EXIT_OK
,	LABEL_EXIT_CANCEL

,	LABEL_MAINMENU_HINT1
,	LABEL_MAINMENU_HINT2
	
,	LABEL_HELP_TEXT
,	LABEL_HELP_BTN_TEXT
	
,	LABEL_COUNT
}



public class BM_GUILayouts
{
	#region Members
	
	#region Landscape
	
	private static readonly Dictionary<GUIComponentNames, Vector2> m_vGUIPositions_Landscape = new Dictionary<GUIComponentNames, Vector2>
	{
		{ GUIComponentNames.COMP_SCREENCENTER, 					new Vector2(0.0f, 	0.0f)		}
		
	,	{ GUIComponentNames.COMP_MAINMENU_PLAYERAREA, 			new Vector2(562.0f, 0.0f)		}
	,	{ GUIComponentNames.COMP_MAINMENU_PLAYBTN, 				new Vector2(-388.0f, -200.0f)	}
	,	{ GUIComponentNames.COMP_MAINMENU_STATSBTN, 			new Vector2(-388.0f, 155.0f)	}
	,	{ GUIComponentNames.COMP_MAINMENU_AUDIOBTN, 			new Vector2(-840.0f, 430.0f)	}
	,	{ GUIComponentNames.COMP_MAINMENU_FACEBOOK, 			new Vector2(-650.0f, 432.0f)	}	
	,	{ GUIComponentNames.COMP_MAINMENU_CREDITSBTN, 			new Vector2(-676.0f, 383.0f)	}
	,	{ GUIComponentNames.COMP_MAINMENU_BACKBTN, 				new Vector2(-865.0f, -458.0f)	}	
	,	{ GUIComponentNames.COMP_MAINMENU_FWDBTN,				new Vector2(860.0f, -458.0f)	}	
	,	{ GUIComponentNames.COMP_MAINMENU_HINT1,				new Vector2(-150.0f, 120.0f)	}	
	,	{ GUIComponentNames.COMP_MAINMENU_HINT2,				new Vector2(-120.0f, 180.0f)	}
	,	{ GUIComponentNames.COMP_MAINMENU_HELP_PANEL,			new Vector2(0.0f, -40.0f)		}
	,	{ GUIComponentNames.COMP_MAINMENU_HELP_BTN,				new Vector2(680.0f, 360.0f)		}
	,	{ GUIComponentNames.COMP_MAINMENU_EXIT_OK_BTN,			new Vector2(-500.0f, 0.0f)		}
	,	{ GUIComponentNames.COMP_MAINMENU_EXIT_CANCEL_BTN,		new Vector2(500.0f, 0.0f)		}
		
	,	{ GUIComponentNames.COMP_UI_BAR,						new Vector2(0.0f, -460.0f)		}		
		
	,	{ GUIComponentNames.COMP_CUSTOMIZE_HEAD_LEFTBTN, 				new Vector2(-805.0f, -75.0f)	}	
	,	{ GUIComponentNames.COMP_CUSTOMIZE_HEAD_RIGHTBTN, 				new Vector2(-19.0f, -75.0f)		}		
	,	{ GUIComponentNames.COMP_CUSTOMIZE_DRESS_LEFTBTN, 				new Vector2(-805.0f, 214.0f)	}	
	,	{ GUIComponentNames.COMP_CUSTOMIZE_DRESS_RIGHTBTN, 				new Vector2(-19.0f, 214.0f)		}	
	,	{ GUIComponentNames.COMP_CUSTOMIZE_PRIMARYCOAT_UPBTN, 			new Vector2(616.0f, -255.0f)	}	
	,	{ GUIComponentNames.COMP_CUSTOMIZE_PRIMARYCOAT_UPBTN_SEC,	 	new Vector2(718.0f, -255.0f)	}	
	,	{ GUIComponentNames.COMP_CUSTOMIZE_PRIMARYCOAT_DOWNBTN, 		new Vector2(616.0f, 447.0f)		}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_PRIMARYCOAT_DOWNBTN_SEC,		new Vector2(718.0f, 447.0f)		}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_SECONDARYCOAT_UPBTN, 		new Vector2(820.0f, -255.0f)	}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_SECONDARYCOAT_UPBTN_SEC, 	new Vector2(1200.0f, -255.0f)	}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_SECONDARYCOAT_DOWNBTN,		new Vector2(820.0f, 447.0f)		}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_SECONDARYCOAT_DOWNBTN_SEC,	new Vector2(1200.0f, 447.0f)	}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_EDIT_BTN,					new Vector2(-880.0f, 1000.0f)	}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_EDIT_BTN_SEC,				new Vector2(-880.0f, 460.0f)	}
	,	{ GUIComponentNames.COMP_CUSTOMIZE_HINT3,						new Vector2(-745.0f, 335.0f)	}	
		
	,	{ GUIComponentNames.COMP_NETWORK_UPBTN,					new Vector2(-836.0f, -137.0f)		}
	,	{ GUIComponentNames.COMP_NETWORK_DOWNBTN,				new Vector2(-836.0f, 69.0f)			}	
	
	,	{ GUIComponentNames.COMP_PAUSE_PAUSE,					new Vector2(-480.0f, 100.0f)		}	
	,	{ GUIComponentNames.COMP_PAUSE_RESUME_BUTT,				new Vector2(480.0f, -100.0f)		}
	,	{ GUIComponentNames.COMP_PAUSE_PAUSE_BUTT,				new Vector2(-865.0f, -458.0f)		}
	,	{ GUIComponentNames.COMP_PAUSE_QUIT_BUTT,				new Vector2(480.0f, 300.0f)			}
	,	{ GUIComponentNames.COMP_PAUSE_CONFIRM_BUTT,			new Vector2(-480.0f, 290.0f)		}
	,	{ GUIComponentNames.COMP_PAUSE_CANCEL_BUTT,				new Vector2(480.0f, 290.0f)		}
	,	{ GUIComponentNames.COMP_PAUSE_CLOSEMATCH,				new Vector2(0.0f, 290.0f)		}
		
	,	{ GUIComponentNames.COMP_HUD_PAUSEBTN, 					new Vector2(-835.0f, -424.0f)	}		
	,	{ GUIComponentNames.COMP_HUD_PLAYER1SCOREBG, 			new Vector2(-690.0f, 420.0f)	}			
	,	{ GUIComponentNames.COMP_HUD_PLAYER2SCOREBG, 			new Vector2(-230.0f, 420.0f)	}			
	,	{ GUIComponentNames.COMP_HUD_PLAYER3SCOREBG, 			new Vector2(228.0f, 420.0f)		}			
	,	{ GUIComponentNames.COMP_HUD_PLAYER4SCOREBG, 			new Vector2(656.0f, 420.0f)		}				
	,	{ GUIComponentNames.COMP_HUD_PLAYER1MEDAL, 				new Vector2(-860.0f, 355.0f)	}
	,	{ GUIComponentNames.COMP_HUD_PLAYER2MEDAL, 				new Vector2(-407.0f, 355.0f)	}					
	,	{ GUIComponentNames.COMP_HUD_PLAYER3MEDAL, 				new Vector2(59.0f, 355.0f)		}					
	,	{ GUIComponentNames.COMP_HUD_PLAYER4MEDAL, 				new Vector2(519.0f, 355.0f)		}						
	,	{ GUIComponentNames.COMP_HUD_PLAYER1HEADICON, 			new Vector2(-790.0f, 414.0f)	}
	,	{ GUIComponentNames.COMP_HUD_PLAYER2HEADICON, 			new Vector2(-327.0f, 414.0f)	}
	,	{ GUIComponentNames.COMP_HUD_PLAYER3HEADICON, 			new Vector2(128.0f, 414.0f)		}
	,	{ GUIComponentNames.COMP_HUD_PLAYER4HEADICON, 			new Vector2(587.0f, 414.0f)		}
		
	,	{ GUIComponentNames.COMP_GAME_LEFTFOOT, 				new Vector2(-150.0f, 390.0f)	}	
	,	{ GUIComponentNames.COMP_GAME_RIGHTFOOT, 				new Vector2(150.0f, 390.0f)		}
	,	{ GUIComponentNames.COMP_GAME_MINUS, 					new Vector2(800.0f, 420.0f)	}		
	,	{ GUIComponentNames.COMP_GAME_PLUS, 					new Vector2(800.0f, 160.0f)	}
	,	{ GUIComponentNames.COMP_GAME_COUNTDOWN, 				new Vector2(-620.0f, -270.0f)	}
	,	{ GUIComponentNames.COMP_GAME_SWIPEFEEDBACK, 			new Vector2(620.0f, 0.0f)		}
	,	{ GUIComponentNames.COMP_GAME_INSHAPE_ACTION, 			new Vector2(-620.0f, -300.0f)	}
	,	{ GUIComponentNames.COMP_GAME_FEETCHACHA_ACTION, 		new Vector2(-620.0f, -300.0f)	}
	,	{ GUIComponentNames.COMP_GAME_ROLLING_ACTION, 			new Vector2(-620.0f, -300.0f)	}
	,	{ GUIComponentNames.COMP_GAME_SPITFIRE_ACTION, 			new Vector2(-620.0f, -300.0f)	}
	,	{ GUIComponentNames.COMP_GAME_HOM_COUNTER, 				new Vector2(785.0f, -200.0f)	}
	,	{ GUIComponentNames.COMP_GAME_HOM_TOTAL, 				new Vector2(80.0f, -180.0f)		}
	,	{ GUIComponentNames.COMP_GAME_HOM_POINTS, 				new Vector2(-10.0f, 290.0f)		}
	,	{ GUIComponentNames.COMP_GAME_HOM_COIN, 				new Vector2(145.0f, 370.0f)		}
	,	{ GUIComponentNames.COMP_GAME_HOM_CHARACTER, 			new Vector2(-240.0f, -180.0f)	}
		
	,	{ GUIComponentNames.COMP_PAUSE_COUNTDOWN, 				new Vector2(0.0f, 0.0f)	}
		
	,	{ GUIComponentNames.COMP_LOADING_BACKGROUND, 			new Vector2(0.0f, 0.0f)		}
	,	{ GUIComponentNames.COMP_LOADING_PROGRESS_BACKGROUND, 	new Vector2(750.0f, 400.0f)		}
	,	{ GUIComponentNames.COMP_LOADING_PROGRESS_FOREGROUND, 	new Vector2(750.0f, 400.0f)		}
	};

	private static readonly Dictionary<GUITriggerNames, Vector2> m_vGUITriggersSize_Landscape = new Dictionary<GUITriggerNames, Vector2>
	{
		{ GUITriggerNames.TRIGGER_DUMMY,							new Vector2(200.0f, 100.0f)		}
	
	,	{ GUITriggerNames.TRIGGER_MAINMENU_CUSTOMIZE,	new Vector2(566.0f, 722.0f)		}
	,	{ GUITriggerNames.TRIGGER_MAINMENU_PLAY,		new Vector2(1068.0f, 524.0f)	}
	,	{ GUITriggerNames.TRIGGER_MAINMENU_CREDITS,		new Vector2(138.0f, 112.0f)		}	
	,	{ GUITriggerNames.TRIGGER_MAINMENU_AUDIO,		new Vector2(174.0f, 141.0f)		}	
	,	{ GUITriggerNames.TRIGGER_MAINMENU_BACK,		new Vector2(200.0f, 180.0f)		}	
	,	{ GUITriggerNames.TRIGGER_MAINMENU_FWD,			new Vector2(200.0f, 180.0f)		}
	,	{ GUITriggerNames.TRIGGER_MAINMENU_EXIT_OK,		new Vector2(580.0f, 304.0f)		}
	,	{ GUITriggerNames.TRIGGER_MAINMENU_EXIT_CANCEL,	new Vector2(580.0f, 304.0f)		}
	,	{ GUITriggerNames.TRIGGER_CUSTOMIZATION_UP,		new Vector2(200.0f, 200.0f)		}
	,	{ GUITriggerNames.TRIGGER_HELP_BTN,				new Vector2(580.0f, 304.0f)		}
	
	,	{ GUITriggerNames.TRIGGER_HUD_PAUSE,			new Vector2(142.0f, 116.0f)		}
	,	{ GUITriggerNames.TRIGGER_PAUSE_TEXTBUTTON,		new Vector2(580.0f, 304.0f)		}
	,	{ GUITriggerNames.TRIGGER_PAUSE_PAUSEBUTTON,	new Vector2(200.0f, 180.0f)		}
		
	,	{ GUITriggerNames.TRIGGER_GAME_FOOT,			new Vector2(300.0f, 300.0f)		}
	,	{ GUITriggerNames.TRIGGER_GAME_PLUSMINUS,		new Vector2(142.0f, 116.0f)		}
	};

	private static readonly Dictionary<GUILabelNames, Rect> m_vGUILabelsRect_Landscape = new Dictionary<GUILabelNames, Rect>
	{
		// Rettangoli espressi rispetto al centro dello schermo e con pivot al centro
		{ GUILabelNames.LABEL_DUMMY,				new Rect(0.0f, 0.0f, 100.0f, 100.0f)		}	
	
	,	{ GUILabelNames.LABEL_PLAYER1SCORE,			new Rect(-625.0f, 430.0f, 200.0f, 100.0f)	}	
	,	{ GUILabelNames.LABEL_PLAYER2SCORE,			new Rect(-160, 	430.0f, 200.0f, 100.0f)		}	
	,	{ GUILabelNames.LABEL_PLAYER3SCORE,			new Rect(297.0f, 430.0f, 200.0f, 100.0f)	}	
	,	{ GUILabelNames.LABEL_PLAYER4SCORE,			new Rect(725.0f, 430.0f, 200.0f, 100.0f)	}
		
	,	{ GUILabelNames.LABEL_GAME_COUNTER,			new Rect(720.0f, -200.0f, 400.0f, 250.0f)	}
	,	{ GUILabelNames.LABEL_GAME_REALCOUNTER,		new Rect(150.0f, -190.0f, 450.0f, 300.0f)	}
	,	{ GUILabelNames.LABEL_GAME_POINTS,			new Rect(-95.0f, 370.0f, 300.0f, 180.0f)	}
		
	,	{ GUILabelNames.LABEL_TITLEBAR,				new Rect(0.0f, -470.0f, 1920.0f, 100.0f)	}
	,	{ GUILabelNames.LABEL_PAUSE_TITLEBAR,		new Rect(0.0f, -400.0f, 1920.0f, 100.0f)	}
	,	{ GUILabelNames.LABEL_RESUME_BUTTON,		new Rect(480.0f, -100.0f, 580.0f, 304.0f)	}
	,	{ GUILabelNames.LABEL_QUIT_BUTTON,			new Rect(480.0f, 300.0f, 580.0f, 304.0f)	}
	,	{ GUILabelNames.LABEL_CONFIRM_BUTTON,		new Rect(-480.0f, 290.0f, 580.0f, 304.0f)	}
	,	{ GUILabelNames.LABEL_CANCEL_BUTTON,		new Rect(480.0f, 290.0f, 580.0f, 304.0f)	}
	,	{ GUILabelNames.LABEL_CLOSEMATCH_BUTTON,	new Rect(0.0f, 290.0f, 580.0f, 304.0f)	}
	,	{ GUILabelNames.LABEL_WAIT_CONFIRM,			new Rect(0.0f, 0.0f, 1920.0f, 1080.0f)		}
	,	{ GUILabelNames.LABEL_CONFIRM_QUIT,			new Rect(0.0f, -150.0f, 1920.0f, 540.0f)	}
	,	{ GUILabelNames.LABEL_EXIT_OK,				new Rect(-500.0f, 0.0f, 580.0f, 304.0f)		}
	,	{ GUILabelNames.LABEL_EXIT_CANCEL,			new Rect(500.0f, 0.0f, 580.0f, 304.0f)		}

	,	{ GUILabelNames.LABEL_MAINMENU_HINT1,		new Rect(-150.0f, 120.0f, 800.0f, 450.0f)	}	
	,	{ GUILabelNames.LABEL_MAINMENU_HINT2,		new Rect(-120.0f, 200.0f, 1000.0f, 400.0f)	}	
	
	,	{ GUILabelNames.LABEL_HELP_TEXT,			new Rect(0.0f, -40.0f, 1880.0f, 645.0f)		}
	,	{ GUILabelNames.LABEL_HELP_BTN_TEXT,		new Rect(680.0f, 360.0f, 500.0f, 175.0f)	}
	};
	
	private static readonly Dictionary<GUI3DComponentNames, Vector3> m_vGUI3DPositions = new Dictionary<GUI3DComponentNames, Vector3>
	{
		{ GUI3DComponentNames.COMP_SCREENCENTER, 				new Vector3(0.0f, 	0.0f,	0.0f)	}
	,	{ GUI3DComponentNames.COMP_BEYONDLEFTSCREEN, 			new Vector3(-BM_Utils.ScreenWidth, 	0.0f,	0.0f)	}
	,	{ GUI3DComponentNames.COMP_BEYONDRIGHTSCREEN, 			new Vector3(BM_Utils.ScreenWidth, 	0.0f,	0.0f)	}
		
	,	{ GUI3DComponentNames.COMP_HEADSELECTORCENTER, 			new Vector3(0.0f, 	0.0f,	0.0f)	}
	,	{ GUI3DComponentNames.COMP_DRESSSELECTORCENTER, 		new Vector3(0.0f, 	0.0f,	0.0f)	}	
	,	{ GUI3DComponentNames.COMP_PRIMARYCOATSELECTORCENTER, 	new Vector3(0.0f, 	0.0f,	0.0f)	}	
		
	,	{ GUI3DComponentNames.COMP_MAINMENU_PLAYER, 			new Vector3(0.0f, 	-0.5f,	-7.4f)	}
	};
	
	#endregion
	
	#endregion
	
	private enum AlignmentType
	{
		ALIGN_TOP_SIDE
	,	ALIGN_CENTER_SIDE
	,	ALIGN_CENTER_SIDE_OFFSET
	,	ALIGN_BOTTOM_CENTER
	,	ALIGN_BOTTOM_CENTER_OFFSET
	,	ALIGN_CENTER_CENTER
	,	ALIGN_CENTER_CENTER_OFFSET
	}
	
	
	public static Vector2 GetScaledComponentPosition(GUIComponentNames eGUIComponentName)
	{
		Vector2 vRVal = Vector2.zero;
		
		Dictionary<GUIComponentNames, Vector2> rCurrentDictionary = null;
		if(BM_Utils.DeviceOrientationType == BM_Utils.DeviceOrientation.ORIENTATION_LANDSCAPE)
			rCurrentDictionary = m_vGUIPositions_Landscape;
//		else
//			rCurrentDictionary = m_vGUIPositions_Portrait;
		
		if(rCurrentDictionary.TryGetValue(eGUIComponentName, out vRVal))
		{
			AlignmentType eAlignment = AlignmentType.ALIGN_CENTER_CENTER;
			if(BM_Utils.DeviceOrientationType == BM_Utils.DeviceOrientation.ORIENTATION_LANDSCAPE)
			{
				switch(eGUIComponentName)
				{
				case GUIComponentNames.COMP_MAINMENU_PLAYBTN:
				case GUIComponentNames.COMP_MAINMENU_AUDIOBTN:
				case GUIComponentNames.COMP_MAINMENU_FACEBOOK:
				case GUIComponentNames.COMP_MAINMENU_BACKBTN:
				case GUIComponentNames.COMP_MAINMENU_FWDBTN:
				case GUIComponentNames.COMP_UI_BAR:
				case GUIComponentNames.COMP_PAUSE_PAUSE_BUTT:
				case GUIComponentNames.COMP_GAME_LEFTFOOT:
				case GUIComponentNames.COMP_GAME_RIGHTFOOT:
				case GUIComponentNames.COMP_LOADING_PROGRESS_BACKGROUND:
				case GUIComponentNames.COMP_LOADING_PROGRESS_FOREGROUND:
				case GUIComponentNames.COMP_CUSTOMIZE_EDIT_BTN:
				case GUIComponentNames.COMP_CUSTOMIZE_EDIT_BTN_SEC:
				case GUIComponentNames.COMP_CUSTOMIZE_HINT3:
					eAlignment = AlignmentType.ALIGN_TOP_SIDE;
					break;
					
				case GUIComponentNames.COMP_GAME_PLUS:
				case GUIComponentNames.COMP_GAME_MINUS:
				case GUIComponentNames.COMP_GAME_HOM_COUNTER:
					eAlignment = AlignmentType.ALIGN_CENTER_SIDE;
					break;
					
//				case ...:
//					eAlignment = AlignmentType.ALIGN_CENTER_CENTER_OFFSET;
//					break;
					
				default:
					eAlignment = AlignmentType.ALIGN_CENTER_CENTER;
					break;
				}
			}
			else
			{
				switch(eGUIComponentName)
				{
//				case ...:
//					eAlignment = AlignmentType.ALIGN_TOP_SIDE;
//					break;
					
//				case ...:
//					eAlignment = AlignmentType.ALIGN_CENTER_SIDE;
//					break;
					
//				case ...:
//					eAlignment = AlignmentType.ALIGN_BOTTOM_CENTER;
//					break;
					
//				case ...:
//					eAlignment = AlignmentType.ALIGN_BOTTOM_CENTER_OFFSET;
//					break;
					
//				case ...:
//					eAlignment = AlignmentType.ALIGN_CENTER_CENTER_OFFSET;
//					break;
					
				default:
					eAlignment = AlignmentType.ALIGN_CENTER_CENTER;
					break;
				}
			}
			
			switch(eAlignment)
			{
			
			// TOP-SIDE
			case AlignmentType.ALIGN_TOP_SIDE:
				vRVal.x *= BM_Utils.ScreenWidth/BM_Utils.RefScreenSize.x;
				vRVal.y *= BM_Utils.ScreenHeight/BM_Utils.RefScreenSize.y;
				
			
//				if(!CM_GameConfig.Instance().UseAdMobPlugin)
//				{
//					float fOffset = CM_Utils.LandscapeVerticalOffsetNormalized * CM_Utils.ScreenHeight;
//					vRVal.y = (vRVal.y >= 0) ? (vRVal.y-fOffset) : (vRVal.y+fOffset);
//				}
				
				break;
				
				
			// CENTER-SIDE
			case AlignmentType.ALIGN_CENTER_SIDE:
			case AlignmentType.ALIGN_CENTER_SIDE_OFFSET:
				
				vRVal.x *= BM_Utils.ScreenWidth/BM_Utils.RefScreenSize.x;
				vRVal.y *= BM_Utils.ScaleFactor;
				
//				if(CM_GameConfig.Instance().UseAdMobPlugin && eAlignment != AlignmentType.ALIGN_CENTER_SIDE_OFFSET)
//				{
//					float fOffset = CM_Utils.LandscapeVerticalOffsetNormalized * CM_Utils.ScreenHeight * 0.5f;
//					vRVal.y = (vRVal.y-fOffset);
//				}
				break;
				
			
			// BOTTOM-CENTER
			case AlignmentType.ALIGN_BOTTOM_CENTER:
			case AlignmentType.ALIGN_BOTTOM_CENTER_OFFSET:
				vRVal.x *= BM_Utils.ScaleFactor;
				vRVal.y *= BM_Utils.ScreenHeight/BM_Utils.RefScreenSize.y;
				
//				if(CM_GameConfig.Instance().UseAdMobPlugin && eAlignment != AlignmentType.ALIGN_BOTTOM_CENTER_OFFSET)
//				{
//					float fOffset = CM_Utils.LandscapeVerticalOffsetNormalized * CM_Utils.ScreenHeight;
//					vRVal.y = (vRVal.y-fOffset);
//				}
				break;
		
			// CENTER-CENTER
			case AlignmentType.ALIGN_CENTER_CENTER:
			case AlignmentType.ALIGN_CENTER_CENTER_OFFSET:
				vRVal *= BM_Utils.ScaleFactor;
				
				
//				if(CM_GameConfig.Instance().UseAdMobPlugin && eAlignment != AlignmentType.ALIGN_CENTER_CENTER_OFFSET)
//				{
//					float fOffset = CM_Utils.LandscapeVerticalOffsetNormalized * CM_Utils.ScreenHeight * 0.5f;
//					vRVal.y = (vRVal.y-fOffset);
//				}
				break;
				
			default:
				break;
			}
		}

		return vRVal;
	}
	
	public static Vector3 Get3DComponentPosition(GUI3DComponentNames eGUI3DComponentName)
	{
		Vector3 vRVal = Vector3.zero;
		
		if(!m_vGUI3DPositions.TryGetValue(eGUI3DComponentName, out vRVal))
		{
			Debug.LogError("Impossibile caricare la posizione 3d di '"+eGUI3DComponentName+"'");
			Debug.DebugBreak();
		}

		return vRVal;
	}
	
	public static Rect GetGUITriggerRect(GUITriggerNames eTriggerName, Vector2 vPosition)
	{
		Rect rectRVal = new Rect(0.0f, 0.0f, 0.0f, 0.0f);
		
		
		Dictionary<GUITriggerNames, Vector2> rCurrentDictionary = null;
		if(BM_Utils.DeviceOrientationType == BM_Utils.DeviceOrientation.ORIENTATION_LANDSCAPE)
			rCurrentDictionary = m_vGUITriggersSize_Landscape;
//		else
//			rCurrentDictionary = m_vGUITriggersSize_Portrait;
		
	
		Vector2 vRefSize = Vector2.zero;
		if(rCurrentDictionary.TryGetValue(eTriggerName, out vRefSize))
		{
			rectRVal.width = vRefSize.x*BM_Utils.ScaleFactor;
			rectRVal.height = vRefSize.y*BM_Utils.ScaleFactor;
			rectRVal.center = vPosition + BM_Utils.ScreenSize*0.5f;
		}
		
		return rectRVal;
	}
	
	public static Rect GetGUILabelRect(GUILabelNames eLabelName)
	{
		Rect rectRVal = new Rect(0.0f, 0.0f, 0.0f, 0.0f);
		
		
		Dictionary<GUILabelNames, Rect> rCurrentDictionary = null;
		if(BM_Utils.DeviceOrientationType == BM_Utils.DeviceOrientation.ORIENTATION_LANDSCAPE)
			rCurrentDictionary = m_vGUILabelsRect_Landscape;
//		else
//			rCurrentDictionary = m_vGUILabelsRect_Portrait;
		

		if(rCurrentDictionary.TryGetValue(eLabelName, out rectRVal))
		{
			rectRVal.width *= BM_Utils.ScaleFactor;
			rectRVal.height *= BM_Utils.ScaleFactor;
			
			switch(eLabelName)
			{
				
				// TOP - SIDE
			case GUILabelNames.LABEL_TITLEBAR:
				rectRVal.x = (BM_Utils.ScreenWidth*0.5f) + ((rectRVal.x*(BM_Utils.ScreenWidth/BM_Utils.RefScreenSize.x)) - (rectRVal.width * 0.5f));
				rectRVal.y = (BM_Utils.ScreenHeight*0.5f) + ((rectRVal.y*(BM_Utils.ScreenHeight/BM_Utils.RefScreenSize.y)) - (rectRVal.height * 0.5f));
				
//				if(!CM_GameConfig.Instance().UseAdMobPlugin)
//					rectRVal.y += SV_Utils.LandscapeVerticalOffsetNormalized * SV_Utils.ScreenHeight;
				
				break;
				
			
				// BOTTOM - CENTER
//			case GUILabelNames.LABEL_HUD_TIMER_BESTTIME:
//			case GUILabelNames.LABEL_HUD_TIMER_CURRENTTIME:
//			case GUILabelNames.LABEL_HUD_TIMER_CURRENTTIME_SHADOW:
//				
//				if(CM_Utils.DeviceOrientationType == CM_Utils.DeviceOrientation.ORIENTATION_LANDSCAPE)
//				{
//					rectRVal.x = (CM_Utils.ScreenWidth*0.5f) + ((rectRVal.x*(CM_Utils.ScreenWidth/CM_Utils.RefScreenSize.x)) - (rectRVal.width * 0.5f));
//					rectRVal.y = (CM_Utils.ScreenHeight*0.5f) + ((rectRVal.y*CM_Utils.ScaleFactor) - (rectRVal.height * 0.5f));
//				}
//				else
//				{
//					rectRVal.x = (CM_Utils.ScreenWidth*0.5f) + ((rectRVal.x*CM_Utils.ScaleFactor) - (rectRVal.width * 0.5f));
//					rectRVal.y = (CM_Utils.ScreenHeight*0.5f) + ((rectRVal.y*(CM_Utils.ScreenHeight/CM_Utils.RefScreenSize.y)) - (rectRVal.height * 0.5f));
//				}
//				
////				if(CM_GameConfig.Instance().UseAdMobPlugin)
////					rectRVal.y -= SV_Utils.LandscapeVerticalOffsetNormalized * SV_Utils.ScreenHeight;
//				
//				break;
				
				// CENTER - CENTER
			default:
				rectRVal.x = (BM_Utils.ScreenWidth*0.5f) + ((rectRVal.x*BM_Utils.ScaleFactor) - (rectRVal.width * 0.5f));
				rectRVal.y = (BM_Utils.ScreenHeight*0.5f) + ((rectRVal.y*BM_Utils.ScaleFactor) - (rectRVal.height * 0.5f));
				
//				if(CM_GameConfig.Instance().UseAdMobPlugin)
//					rectRVal.y -= SV_Utils.LandscapeVerticalOffsetNormalized * SV_Utils.ScreenHeight * 0.5f;
				break;
			}
		}
		
		return rectRVal;
	}
}